/**
 * @description 房屋信息表
 * @date 2020-08-12 10:16
 * @auth LI
 */

const seq = require('../sequelize')
const { STRING, INTEGER, DATE } = require('../types')

// account account 写入到数据库时为 accounts
const HouseInfo = seq.define('houseInfo', {
  houseName: {
    type: STRING,
    comment: '业主名称'
  },
  houseAddress: {
    type: STRING,
    comment: '房子地址'
  },
  roomType: {
    type: STRING,
    comment: '房型'
  },
  startTime: {
    type: DATE,
    comment: '开工时间'
  },
  endTime: {
    type: DATE,
    comment: '竣工时间'
  },
  drawing: {
    type: STRING,
    comment: '图纸'
  },
  status: {
    type: INTEGER,
    defaultValue: 0,
    comment: '施工状态/0开始施工/1施工中/2工长确认/3监理确认/4施工结束'
  },
  houseOwnerId: {
    type: INTEGER,
    comment: '对应账号表业主 id'
  },
  supervisionId: {
    type: INTEGER,
    comment: '对应账号表监理 id'
  },
  foremanId: {
    type: INTEGER,
    comment: '对应账号表工长 id'
  },
  bricklayerId: {
    type: INTEGER,
    comment: '对应账号表瓦工 id'
  },
  carpenterId: {
    type: INTEGER,
    comment: '对应账号表木工 id'
  },
  plumberId: {
    type: INTEGER,
    comment: '对应账号表水电工 id'
  },
  painterId: {
    type: INTEGER,
    comment: '对应账号表油漆工 id'
  },
  remark: {
    type: STRING,
    comment: '要求，备注'
  },
  reserve: {
    type: STRING,
    comment: '保留字段'
  }
},
{
  comment: '房屋信息表',
})

module.exports = HouseInfo
